package com.feizhaiyou.test.entity;

import com.feizhaiyou.encrypt.annotation.Security;
import com.feizhaiyou.encrypt.annotation.Sensitive;
import com.feizhaiyou.encrypt.constants.SensitiveType;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @author ls
 * @since 2023-07-28
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class User {

    private String id;

    // 同时使用会对响应先进行@Sensitive脱敏后进行@Security加密
    // name 即加密又解密
//    @Security
    @Sensitive(type = SensitiveType.CHINESE_NAME)
    private String name;

    @Sensitive(type = SensitiveType.ID_CARD)
//    @Security
    private String idCard;

//    @Sensitive(type = SensitiveType.EMAIL)
    @Security(encrypt = false)
    private String email;

    @Sensitive(type = SensitiveType.MOBILE_PHONE)
    private String phone;

    private List<Address> addressList;
}
